package com.example.demo.TemplateMethodMode;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

/**
 * 场景类
 */
public class Client {

//    public static void main(String[] args) {
//        HummerModel hummerModel = new HummerH1Model();
//        hummerModel.run();
//        System.out.println("-------------------");
//
//        HummerModel hummerH2Model = new HummerH2Model();
//        hummerH2Model.run();
//
//        AbstractClass concreteClass1 = new ConcreteClass1();
//        concreteClass1.templateMethod();
//        ConcreteClass2 concreteClass2 = new ConcreteClass2();
//        concreteClass2.templateMethod();
//    }

    public static void main(String[] args) throws IOException {
        System.out.println("-------H1型号悍马--------");
        System.out.println("H1型号的悍马是否需要喇叭声响？0-不需要 1-需要");
        String type=(new BufferedReader(new InputStreamReader(System.in))).readLine();
        HummerH1Model h1 = new HummerH1Model();
        if(type.equals("0")){
            h1.setAlarm(false);
        }
        h1.run();
        System.out.println("\n-------H2型号悍马--------");
        HummerH2Model h2 = new HummerH2Model();
        h2.run();
    }
}
